Method and apparatus for low cost motion detection

ABSTRACT

A non-frame-based motion detection method and apparatus for imagers requires only a few line buffers and little computation. The non-frame-based, low cost motion detection method and apparatus are well suited for “system-a-chip” (SOC) imager implementations.

FIELD OF THE INVENTION

Embodiments of the invention relate to imagers and more particularly tomotion detection for imagers.

BACKGROUND

FIG. 1 shows an example surveillance system 10 having a video camera 12,a controller 14, an alarm system 16 and a recording device 18. Thecamera 12 includes an imager for capturing a viewed scene and a motiondetection feature, which outputs a motion signal to the controller 14when motion is detected in the scene viewed by the camera 12. Motiondetection is a desirable feature in security applications. An immediatebenefit of including a motion detection feature in the camera 12 is thatthe feature helps save recording space by only activating the videorecording device 18 (and/or only sending the detected moving region toan encoder for compression) when motion is detected. Another benefit ofmotion detection is that it allows the camera 12 to send an alert to thesecurity personal in the viewing room causing them to focus on thespecific area where motion has been detected. This is especially usefulwhen there are many monitors in the viewing room that are connected tomany different cameras, such as e.g., in a casino viewing room. Thealarm system 16 could also be triggered by the controller 14 when motionis detected by the camera 12.

Conventional motion detection algorithms use temporal processing thatcompares an image of the current frame with a reference frame image andthen counts the number of pixels that are different between the frames.This type of motion detection technique, however, requires a large framebuffer and, therefore, cannot easily be implemented in system-on-a-chip(SOC) imager systems, which have limited memory resources and generalcircuit area limitations. Moreover, the large frame memory adds cost tothe imager, which is also undesirable.

Accordingly, there exists a need for an improved method and system formotion detection within an imager. There further exists a need for amotion detection system and method that may be implemented in asystem-on-a-chip imager system.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates an example surveillance system.

FIG. 2 illustrates an imager (e.g., a system-on-a-chip imager) havingnon-frame-based motion detection logic/circuitry in accordance with anexample embodiment disclosed herein.

FIG. 3 illustrates an example of detecting motion in a particular areawithin a frame using weighting.

FIG. 4 illustrates an example of detecting motion using sub-sampling.

FIG. 5 shows a processor system incorporating at least one imagingdevice constructed in accordance with an embodiment disclosed herein.

DETAILED DESCRIPTION

Referring to the figures, where like reference numbers designate likeelements, FIG. 2 illustrates an imager (e.g., a system-on-a-chip imager)100 having non-frame-based motion detection circuit 120 in accordancewith an example embodiment disclosed herein. Since motion detection isnot frame-based, a large and expensive frame buffer memory is notrequired. This is beneficial because it reduces memory requirements,used circuit area and the cost of the imager 100. Accordingly, theimager 100 is suitable for a system-on-a-chip implementation. In oneembodiment, the imager 100 is implemented in a video camera 12 (FIG. 1)such that the camera 12 has non-frame-based motion detection asdescribed below. It should be appreciated that the imager 100 can alsobe implemented in a digital still camera (or other camera), which can beoperated to take multiple images over a period of time (e.g., one ormore images per second).

The imager 100 comprises an image sensor 110 and the motion detectioncircuit 120. The image sensor 110 outputs digital data (e.g., pixeldata) representing the image captured by the sensor 110 to the motiondetection circuit 120. The image sensor 110 can be a CMOS image sensor,CCD image sensor or other suitable imaging device capable of imaging ascene and outputting a digital representation (i.e., digital image data)of the imaged scene. The digital representation is typically processedby an image processor within the imager before being output as a digitalimage. CMOS imagers, e.g., are generally known as discussed, forexample, in U.S. Pat. No. 6,140,630, U.S. Pat. No. 6,376,868, U.S. Pat.No. 6,310,366, U.S. Pat. No. 6,326,652, U.S. Pat. No. 6,204,524 and U.S.Pat. No. 6,333,205, assigned to Micron Technology, Inc. Suitable CCD andother imagers are also known in the art.

The motion detection circuit 120 includes four line buffers 122, 124,126, 128 instead of a frame buffer memory used in prior art motiondetection techniques. The line buffers 122, 124, 126, 128 arerespectively associated with a current weighted column average (WCA)process 132, a reference WCA process 134, a reference weighted rowaverage (WRA) process 136 and a current WRA process 138. Additionalprocessing included in the motion detection circuit 120 include: twoabsolute difference processes 142, 152, threshold processes 144, 154,consolidation processes 146, 156, a Cartesian product process 160, ahorizontal camera motion compensation process 148 and a vertical cameramotion compensation process 150, which are described in more detailbelow. The processes 132, 134, 136, 138, 142, 144, 146, 148, 150, 152,154, 156, 160 can be performed in logic circuit 121 or a processorincluded in the motion detection circuit 120.

As set forth above, the illustrated embodiment eliminates the framebuffer used for storing the reference frame used in prior motiondetection systems. Certain information from the reference frame,however, is still needed because motion detection is essentially atemporal process requiring comparison of current information toreference information. Accordingly, the illustrated embodimentrepresents the current image data and reference data in a compact way sothat the amount of data is reduced while the key information needed formotion detection is retained. As can be seen, at most, only four linebuffers 122, 124, 126, 128 are required to implement the disclosedmotion detection processing.

This reduction in memory results from the use of weighted row averagesand weighted column averages to represent the reference and currentimage frames in a compact manner. This way, two-dimensional image data(i.e., row by column data) is reduced to two lines of one-dimensionaldata (i.e., row only and column only). Instead of using a frame bufferto store an array of reference frame data, the illustrated embodimentuses only two line buffers 124, 126 to store separate one-dimensionallines of reference data. Likewise, only two line buffers 122, 128 arerequired to store the one-dimensional current image weighted row andweighted column averages. At the beginning of the disclosed motiondetection procedure only the weighted row and column average data of thereference frame are computed and stored. The stored reference weightedrow and weighted column average data can be updated as needed during theprocedure.

Let f(x,y) denote a video frame. The weighted row average, denoted byA_(row)(f)(y), is defined in equation (1) as follows:

$\begin{matrix}{{{{A_{row}(f)}(y)} = \frac{\sum\limits_{x = 0}^{x = {{width} - 1}}{w_{x} \cdot {f\left( {x,y} \right)}}}{\sum\limits_{x = 0}^{x = {{width} - 1}}w_{x}}},} & (1)\end{matrix}$

where “width” is the number of columns in the image frame. The weightedcolumn average, denoted by A_(col)(f)(x), is defined in equation (2) asfollows:

$\begin{matrix}{{{{A_{col}(f)}(x)} = \frac{\sum\limits_{y = 0}^{y = {{height} - 1}}{v_{y} \cdot {f\left( {x,y} \right)}}}{\sum\limits_{y = 0}^{y = {{height} - 1}}v_{y}}},} & (2)\end{matrix}$

where “height” is the number of rows in the image frame.

Typically, the weights w_(x) and v_(y) are set to 1 such that the valuesof all pixels in the frame are used to compute the weighted row andcolumn averages. The advantage of using weighted averages is that theyprovide the flexibility of specifying a particular area of interest tomonitor for motion detection. For example, an area of interest can bedefined by setting the weights for pixels within the area of interest to‘1’ and setting the weights of the remaining pixels of the frame to ‘0’.FIG. 3 illustrates an example frame 200 in which the left-most upperquadrant is an area of interest 210 is to be monitored for motiondetection. As set forth above, weights w_(x) and v_(y) are set to 1 forpixels within the area of interest 210, while the weights w_(x) andv_(y) for all other pixels are set to 0.

In another embodiment, sub-sampled image data (without actuallysub-sampling the image) can be used in the motion detection process. Tosub-sample the image data, non-zero weights w_(x) and v_(y) are used fora sample of pixels 242 (shown as shaded pixels for illustrative purposesonly) in the image frame 240 while all of the weights w_(x) and v_(y)for the remaining pixels 244 are set to ‘0’ (as shown in FIG. 4). Itshould be appreciated that sub-sampling can further reduce the amount ofrequired line buffer memory by at least a half.

The weighted column averages are used to detect horizontal motion, ifany. Let f_(c)(x,y) denote the current frame, and f_(r)(x,y) denote thereference frame. Then the current frame weighted column average isA_(col)(f)(x), which is computed in the current WCA process 132 usingequation (2), and the reference frame weighted column average isA_(col)(f_(r))(x), which is computed in the reference WCA process 134using equation (2). The computed current frame weighted column averageis stored in line buffer 122 while the computed reference frame weightedcolumn average is stored in line buffer 124. That is, the entire framesare not stored in the circuit 120.

Before detecting horizontal motion, it is desirable to estimate andcompensate for any horizontal camera movement because the motiondetection feature disclosed herein is interested in object motion withinthe imaged scene, not camera motion. The horizontal camera motion isestimated in the horizontal camera motion compensation process 148. Inprocess 148, the SAD (sum of absolute difference) defined in equation(3) below is minimized with respect to the parameter s within a certainrange. Although not to be taken as limiting the disclosed embodiment, ina desired embodiment, the range for s is [−16,+16].

$\begin{matrix}{{S\; A\; {D_{H}(s)}} = {\sum\limits_{x = 0}^{x = {{width} - 1}}{{{{A_{col}\left( f_{c} \right)}(x)} - {{A_{col}\left( f_{r} \right)}\left( {x + s} \right)}}}}} & (3)\end{matrix}$

The minimization can be achieved by performing an exhaustive search of swithin its range. The value of s that minimizes the SAD_(H)(S) inequation (3), denoted herein as s₀, represents the horizontal cameramotion. To compensate for this horizontal camera motion, the referenceframe weighted column average stored in line buffer 124 is shifted bys₀, i.e., A_(col)(f_(r))(x+s₀). The shifted reference frame weightedcolumn average can be stored in line buffer 124, replacing the priorreference frame weighted column average, for subsequent use as describedbelow. Alternatively, parameter so can be stored or passed ontosubsequent processing without having to replace the reference frameweighted column average already stored in line buffer 124. It should beappreciated that the horizontal camera motion compensation process 148(and the vertical camera motion compensation process 150) can be skippedif the imager 100 is securely mounted, or otherwise not subject to anymotion, if desired.

As discussed below in more detail, the illustrated embodiment detectshorizontal motion by generating a horizontal motion mask. Once thehorizontal camera motion has been compensated for in process 148, thehorizontal motion detection process continues at absolute differenceprocess 142. Absolute difference process 142 computes the absolutedifference D_(H)(x) between the weighted column average of the currentframe, A_(col)(f_(c))(x), and the horizontal camera motion compensatedweighted column average of the reference frame, A_(col)(f_(r))(x+s₀), asshown below in equation (4):

D _(H)(x)=|A _(col)(f _(c))(x)−A _(col)(f _(r))(x+s ₀)|  (4)

The absolute difference D_(H)(x) is input by threshold process 144,which thresholds the difference D_(H)(x) to create a thresholdedabsolute difference M_(H)(x) according to equation (5):

$\begin{matrix}{{M_{H}(x)} = \left\{ \begin{matrix}{1,} & {{{if}\mspace{14mu} {D_{H}(x)}} > T_{H}} \\{0,} & {otherwise}\end{matrix} \right.} & (5)\end{matrix}$

The threshold T_(H) can be determined before hand based on common motiondetection principles or it may be an application specific thresholdT_(H). It should be appreciated that how the threshold T_(H) is set doesnot limit the disclosed embodiments. Once the thresholded absolutedifference M_(H)(x) is computed, the consolidation process 146 appliesmorphology-like operators such as closing and opening to respectivelyfill out small gaps and eliminate small segments in M_(H)(x) to generatethe final horizontal motion mask {tilde over (M)}_(H)(x) that consistsof significant non-zero connected components.

The weighted row averages discussed above are used to detect verticalmotion, if any. Let A_(row)(f_(c))(y) and A_(row)(f_(r))(y) be theweighted row averages for the current frame and the reference frame,respectively, which are respectively computed in processes 138 and 136using equation (1) discussed above. The computed current frame weightedrow average is stored in line buffer 128 while the computed referenceframe weighted row average is stored in line buffer 126.

Similar to the horizontal motion detection, it is desirable to estimateand compensate for any vertical camera motion before performing verticalmotion detection. The vertical camera motion is estimated in thevertical camera motion compensation process 150. In process 150, the SAD(sum of absolute difference) defined in equation (6) below is minimizedwith respect to the parameter t within a certain range. Although not tobe taken as limiting the disclosed embodiment, in a desired embodiment,the range for t is [−16,+16].

$\begin{matrix}{{S\; A\; {D_{V}(t)}} = {\sum\limits_{y = 0}^{y = {{height} - 1}}{{{{A_{row}\left( f_{c} \right)}(y)} - {{A_{row}\left( f_{r} \right)}\left( {y + t} \right)}}}}} & (6)\end{matrix}$

The minimization can be achieved by performing an exhaustive search of twithin its range. The value of t that minimizes the SAD_(V)(t) inequation (6), denoted herein as t₀, represents the vertical cameramotion. To compensate for this vertical camera motion, the referenceframe weighted row average stored in line buffer 126 is shifted by to,i.e., A_(row)(f_(r))(y+t₀). The shifted reference frame weighted rowaverage can be stored in line buffer 126, replacing the prior referenceframe weighted row average, for subsequent use as described below.Alternatively, parameter t₀ can be stored or passed onto subsequentprocessing without having to replace the reference frame weighted rowaverage already stored in line buffer 126.

As discussed below in more detail, the illustrated embodiment detectsvertical motion by generating a vertical motion mask. Once the verticalcamera motion has been compensated for in process 150, the verticalmotion detection process continues at absolute difference process 152.Absolute difference process 152 computes the absolute differenceD_(V)(y) between the weighted row average of the current frame,A_(row)(f_(c))(y), and the vertical camera motion compensated weightedrow average of the reference frame, A_(row)(f_(r))(y+t₀), as shown belowin equation (7):

D _(V)(y)=|A _(row)(f _(c))(y)−A _(row)(f _(r))(y+t ₀)   (7)

The absolute difference D_(V)(y) is input by threshold process 154,which thresholds the difference D_(V)(y) to create a thresholdedabsolute difference M_(V)(y) according to equation (8):

$\begin{matrix}{{M_{V}(y)} = \left\{ \begin{matrix}{1,} & {{{if}\mspace{14mu} {D_{V}(y)}} > T_{V}} \\{0,} & {otherwise}\end{matrix} \right.} & (8)\end{matrix}$

The threshold T_(V) can be determined before hand based on common motiondetection principles or it may be an application specific thresholdT_(V). It should be appreciated that how the threshold T_(V) is set doesnot limit the disclosed embodiments. Once the thresholded absolutedifference M_(V)(y) is computed, consolidation process 156 appliesmorphology-like operators such as closing and opening to respectivelyfill out small gaps and eliminate small segments in M_(V)(y). Then, astep of connecting all of the non-zero connected components in M_(V)(y)is performed to generate the final vertical motion mask {tilde over(M)}_(V)(y) that consists of one large non-zero connected component.

The Cartesian product process 160 inputs the horizontal and verticalmotion masks {tilde over (M)}_(H)(x), {tilde over (M)}_(V)(y) andcomputes and outputs a two-dimensional (2D) motion mask M_(2D)(x,y). The2D motion mask M_(2D)(x,y) is computed using the Cartesian product ofthe horizontal motion mask {tilde over (M)}_(H)(x) and the verticalmotion mask {tilde over (M)}_(V)(y) as set forth in equation (9):

M _(2D)(x,y)={tilde over (M)} _(H)(x)×{tilde over (M)} _(V)(y)   (9)

The 2D motion mask M_(2D)(x,y) indicates where motion occurred within aframe, with a e.g., a value of ‘1’ indicating motion and value of 0indicating no motion. The 2D motion mask M_(2D)(x,y) may be output fromthe imager 100 (FIG. 1) and used by a controller 14 (FIG. 1) or othersystem component to e.g., trigger an alarm, turn on a recording device,etc. based on the detected motion.

When the motion detection process starts, the data from the firstcaptured frame is used as the reference data described above. As can beappreciated, the reference information will need to be updatedperiodically and/or aperiodically. The rules for updating the referenceinformation may include: a) updating the reference information every Tminutes (i.e., periodic update), where T is application specific; and/orb) updating the reference information when the detected motion areabecomes greater than a predefined portion of the whole frame area (e.g.,⅔ of the whole frame area) (i.e., an aperiodic update). Updating thereference information merely requires overwriting the prior referencedata with the newly calculated weighted row and column averages.

In comparison to the prior art frame-based motion detection algorithms,the disclosed non-frame-based motion detection method and apparatus onlyrequires a few line buffers (four line buffers or less if sub-samplingis used) of memory instead of a whole frame buffer memory. Moreover,because the above-mentioned processing is performed on one-dimensionaldata, the computations of the disclosed motion detection method is veryfast and inexpensive to implement in comparison to other motiondetection systems.

FIG. 5 shows a processor system 500 incorporating at least one imager100 constructed and operated in accordance with an embodiment disclosedherein. In a surveillance video system embodiment, the processor system500 could, for example be a video camera comprising a view finder 534and a lens system 538 for focusing an image on the pixel array of theimager 100. The video camera could be activated to continuously imagescenes and to perform motion detection as described herein. In anotherembodiment, the processor system 500 could, for example be a digitalstill camera comprising a shutter release button 532, the view finder534, a flash 536 and the lens system 538 for focusing an image on thepixel array of the imager 100. In a handheld video system embodiment,the system 500 would be a video camera with the addition of a start/stoprecord button instead of the shutter release button 532.

The system 500 generally also comprises a central processing unit (CPU)502, for example, a microprocessor for controlling functions and whichcommunicates with one or more input/output devices (I/O) 504 over a bus520. The CPU 502 also exchanges data with random access memory (RAM) 514over the bus 520, typically through a memory controller. The camerasystem 500 may also include peripheral devices such as a removablememory 506, which also communicates with CPU 502 over the bus 520. Inthe case of a computer system, the system 500 could also include a CDROM drive 512. Other processor systems which may employ imagers 100containing motion detection as described herein, besides still and videocameras, include computers, PDAs, cellular telephones, scanners, machinevision systems, and other systems requiring imaging applications inresponse to motion detection.

The above description and drawings illustrate various embodiments Itshould be appreciated that modifications, though presentlyunforeseeable, of these embodiments that can be made without departingfrom the spirit and scope of the invention which is defined by thefollowing claims.

1. A method of detecting motion of an object in a first image, saidmethod comprising: determining weighted row and column averages of areference image; determining weighted row and column averages of thefirst image; and detecting motion of the object based on the determinedweighted column and row averages of the reference image and the firstimage.
 2. The method of claim 1 further comprising the steps of:offsetting the weighted row average of the reference image to compensatefor vertical movement of an imager that captured the first image; andoffsetting the weighted column average of the reference image tocompensate for horizontal movement of the imager.
 3. The method of claim2, wherein the detecting motion step comprises: creating a verticalmotion mask based on the determined weighted row average of the firstimage and the offset weighted row average of the reference image;creating a horizontal motion mask based on the determined weightedcolumn average of the first image and the offset weighted column averageof the reference image; and combining the vertical and horizontal motionmasks to create a two-dimensional motion mask comprising at least oneportion indicative of motion of the object.
 4. The method of claim 1,wherein the detecting motion step comprises: creating a vertical motionmask based on the determined weighted row averages of the first andreference images; creating a horizontal motion mask based on thedetermined weighted column average of the first and reference images;and combining the vertical and horizontal motion masks to create atwo-dimensional motion mask comprising at least one portion indicativeof motion of the object.
 5. The method of claim 4, wherein the combiningstep comprises performing a Cartesian product of the vertical andhorizontal motion masks.
 6. The method of claim 4, wherein thehorizontal motion mask creating step comprises: determining an absolutedifference of the weighted column averages of the first image and thereference image; thresholding the absolute difference based on apredetermined threshold; and performing a consolidation process on thethresholded absolute difference to create the horizontal motion mask. 7.The method of claim 4, wherein the vertical motion mask creating stepcomprises: determining an absolute difference of the weighted rowaverages of the first image and the reference image; thresholding theabsolute difference based on a predetermined threshold; performing aconsolidation process on the thresholded absolute difference; andconnecting non-zero connected components in the consolidated thresholdedabsolute difference to create the vertical motion mask.
 8. The method ofclaim 1 further comprising the step of updating the weighted row andcolumn averages of the reference image on a periodic basis.
 9. Themethod of claim 1 further comprising the step of updating the weightedrow and column averages of the reference image on an aperiodic basis.10. The method of claim 9, wherein the weighted row and column averagesof reference image are updated when a detected motion area becomesgreater than a predefined portion of the first image.
 11. The method ofclaim 1, wherein the weighted row and column averages are weighted todetect motion of the object in an area of interest.
 12. The method ofclaim 1, wherein the weighted row and column averages are weighted todetect motion of the object from sub-sampled portions of the first andreference images.
 13. A motion detection circuit comprising: a pluralityof line buffers, a first line buffer for storing a weighted row averageof a reference image, a second line buffer for storing a weighed rowaverage of a first image, a third line buffer for storing a weightedcolumn average of the reference image and a fourth line buffer forstoring a weighted column average of the first image; and logic fordetecting motion of an object in the first image by computing andstoring the weighted row and column averages of the reference and firstimages and detecting the motion of the object based on the determinedweighted column and row averages of the reference and first images. 14.The motion detection circuit of claim 13, wherein said logic offsets theweighted row average of the reference image to compensate for verticalmovement of an imager that captured the first image and offsets theweighted column average of the reference image to compensate forhorizontal movement of the imager.
 15. The motion detection circuit ofclaim 14, wherein the logic detects motion of the object by: creating avertical motion mask based on the determined weighted row average of thefirst image and the offset weighted row average of the reference image;creating a horizontal motion mask based on the determined weightedcolumn average of the first image and the offset weighted column averageof the reference image; and combining the vertical and horizontal motionmasks to create a two-dimensional motion mask comprising at least oneportion indicative of motion of the object.
 16. The motion detectioncircuit of claim 13, wherein the logic detects motion of the object by:creating a vertical motion mask based on the determined weighted rowaverages of the first and reference images; creating a horizontal motionmask based on the determined weighted column average of the first andreference images; and combining the vertical and horizontal motion masksto create a two-dimensional motion mask comprising at least one portionindicative of motion of the object.
 17. The motion detection circuit ofclaim 16, wherein the logic combines the horizontal and vertical motionmasks by performing a Cartesian product of the vertical and horizontalmotion masks.
 18. The motion detection circuit of claim 16, wherein thelogic creates the horizontal motion mask by: determining an absolutedifference of the weighted column averages of the first image and thereference image; thresholding the absolute difference based on apredetermined threshold; and performing a consolidation process on thethresholded absolute difference to create the horizontal motion mask.19. The motion detection circuit of claim 16, wherein the logic createsthe vertical motion mask by: determining an absolute difference of theweighted row averages of the first image and the reference image;thresholding the absolute difference based on a predetermined threshold;performing a consolidation process on the thresholded absolutedifference; and connecting non-zero connected components in theconsolidated thresholded absolute difference to create the verticalmotion mask.
 20. The motion detection circuit of claim 13, wherein saidlogic updates the weighted row and column averages of the referenceimage on a periodic basis.
 21. The motion detection circuit of claim 13,wherein said logic updates the weighted row and column averages of thereference image when a detected motion area becomes greater than apredefined portion of the first image.
 22. The motion detection circuitof claim 13, wherein the weighted row and column averages are weightedto detect motion of the object in an area of interest.
 23. The motiondetection circuit of claim 13, wherein the weighted row and columnaverages are weighted to detect motion of the object from sub-sampledportions of the first and reference images.
 24. An imager comprising: animage sensor for capturing a reference image and a first image and foroutputting digital reference image data and first image data; and amotion detection circuit connected to input the reference image data andthe first image data, said circuit comprising: a plurality of linebuffers, a first line buffer for storing a weighted row average of thereference image, a second line buffer for storing a weighed row averageof the first image, a third line buffer for storing a weighted columnaverage of the reference image and a fourth line buffer for storing aweighted column average of the first image; and a processor programmedto perform motion of an object in the first image, said processorperforming a first process to compute and store the weighted row averageof the reference image, a second process to compute and store theweighted column average of the reference image, a third process tocompute and store the weighted row average of the first image, a fourthprocess to compute and store the weighted column average of the firstimage, and a fifth process for detecting the motion of the object basedon the determined weighted column and row averages of the reference andfirst images.
 25. The imager of claim 24, wherein the processor performsa sixth process for offsetting the weighted row average of the referenceimage to compensate for vertical movement of the image sensor and aseventh process for offsetting the weighted column average of thereference image to compensate for horizontal movement of the imagesensor.
 26. The imager of claim 24, wherein the fifth process comprises:a process for creating a vertical motion mask based on the determinedweighted row averages of the first and reference images; a process forcreating a horizontal motion mask based on the determined weightedcolumn average of the first and reference images; and a process forcombining the vertical and horizontal motion masks to create atwo-dimensional motion mask comprising at least one portion indicativeof motion of the object.
 27. The imager of claim 24, wherein theweighted row and column averages are weighted to detect motion of theobject in an area of interest.
 28. The imager of claim 24, wherein theweighted row and column averages are weighted to detect motion of theobject from sub-sampled portions of the first and reference images. 29.The imager of claim 24, wherein said processor updates the weighted rowand column averages of the reference image on a periodic basis and whena detected motion area becomes greater than a predefined portion of thefirst image.
 30. The imager of claim 24, wherein the weighted rowaverage A_(row)(f)(y) of the reference image or first image is computedaccording to $\begin{matrix}{{{{A_{row}(f)}(y)} = \frac{\sum\limits_{x = 0}^{x = {{width} - 1}}{w_{x} \cdot {f\left( {x,y} \right)}}}{\sum\limits_{x = 0}^{x = {{width} - 1}}w_{x}}},} & \;\end{matrix}$ where f(x,y) is the reference image or the first image,width is the number of columns in the reference image or the firstimage, and w_(x) is an integer.
 31. The imager of claim 24, wherein theweighted column average A_(col)(f)(x) of the reference image or firstimage is computed according to${{{A_{col}(f)}(x)} = \frac{\sum\limits_{y = 0}^{y = {{height} - 1}}{v_{y} \cdot {f\left( {x,y} \right)}}}{\sum\limits_{y = 0}^{y = {{height} - 1}}v_{y}}},$where f(x,y) is the reference image or the first image, height is thenumber of rows in the reference image or the first image, and v_(y) isan integer.